Returns the month of a year from a serial date that is generated by the DateSerial or the DateValue function.
DateSerial ないし DateValue 関数による日付データのシリアル変換値を基に、該当する月を返します。
Month (Number)
Month (Number)
Integer
整数
Number: Numeric expression that contains the serial date number that is used to determine the month of the year.
Number: 月情報を得る日付データのシリアル変換値を示す数値表式。
This function is the opposite of the DateSerial function. It returns the month in the year that corresponds to the serial date that is generated by DateSerial or DateValue. For example, the expression
この関数は、DateSerial 関数と逆方向の機能を担っています。この場合の戻り値としては、日付データを DateSerial や DateValue でシリアル変換した数値を基に、該当する月が返されます。こうした点は、下記のコードを実行してみると分かりやすいでしょう。
Print Month(DateSerial(1994, 12, 20))
Print Month(DateSerial(1994, 12, 20))
returns the value 12.
この場合の戻り値は 12 となります。
Sub ExampleMonth
Sub ExampleMonth
MsgBox "" & Month(Now) ,64,"The current month"
MsgBox "" & Month(Now) ,64,"The current month"
End sub
End sub